package com.carstop.model;

import java.util.List;

public class ProvinceService {
     
	private ProvinceDAO_interface dao;

	public ProvinceService() {
		dao = new ProvinceDAO();
	}

	public ProvinceVO addArea(String province_id, String name,String country_id) {

		ProvinceVO provinceVO = new ProvinceVO();

		provinceVO.setProvince_id(province_id);
		provinceVO.setName(name);
		provinceVO.setCountry_id(country_id);
		dao.insert(provinceVO);

		return provinceVO;
	}

	public ProvinceVO updateEmp(String province_id, String name,String country_id) {

		ProvinceVO provinceVO = new ProvinceVO();

		provinceVO.setProvince_id(province_id);
		provinceVO.setName(name);
		provinceVO.setCountry_id(country_id);
		dao.update(provinceVO);

		return provinceVO;
	}

	public void deleteEmp(String province_id) {
		dao.delete(province_id);
	}

	

	public List<ProvinceVO> getAll() {
		return dao.getAll();
	}
}
